package org.jiangy.authentication;

/**
 * 认证上下文持有者
 * <p>创建时间: 2024/8/13 </p>
 *
 * @author <a href="mailto:jiangliu0316@outlook.com" rel="nofollow">蒋勇</a>
 */
public class AuthenticationContextHolder {
    private static final ThreadLocal<AuthenticationContext> HOLDER = new ThreadLocal<>();

    public static void setContext(AuthenticationContext context) {
        HOLDER.set(context);
    }

    public static AuthenticationContext getContext() {
        return HOLDER.get();
    }

    public static void clearContext() {
        HOLDER.remove();
    }
}
